document.querySelector("html").style.fontSize = (window.innerWidth / 16) + "px";
window.onorientationchange = () => {
  window.location.reload();
};
const gParams = getParams();

const opt = {
  container: document.getElementById("player"),
  // loop: true,
  screenshot: true,
  hotkey: true,
  airplay: true,
  // preload: "auto",
  // logo: "/favicon.ico",
  video: {},
};
const dp = new DPlayer(opt);

function getParams() {
  return JSON.parse(decodeURIComponent(window.location.href.split("?data=")[1]));
}
$(function () {
  if (gParams.video) {
    dp.switchVideo(gParams.video, gParams.danmaku);
  }
})